This is a short document to demonstrate the use of the deleq package and its commands. It uses . deleq was written by Mats Dahlgren (matsd@physchem.kth.se). Suggestions for improvements and bug reports are most welcome, see the documentation. deleq is fully compatible with the leqno option.
We start this demonstration by a simple and well-known equation to get the equation number counter going:
sin2α + cos2α = 1 | (1) |
In the next example we introduce the deqarr
environment for writing equations:
where we also have put in the label Demo1 in
the second equation. Next, notice how the environment
ddeqar uses the same main equation number as
the previous equations:
Now, we will make another eqnarray-like
structure, again in the ddeqar environment:
This example shows the use of \heqno
in the first
equation, which produces an ordinary equation number.
The first equation is also labelled, with the label
Demo2. The next equation's number was produced
by the command \nydeqno
. Also, notice the use of
\rem{or}
, which results in the text ``or'' without
changing the alignment.
To step the equation number counter, we want the
following equations typeset in ordinary
eqnarray environment:
Now one of the ``recycling'' commands is to be demonstrated. First of all, let's make an ordinary reference to equation , and then ``recycle'' it:
$$ ... $$
with the command
\reqno{Demo2}
at the end. Also partially
numbered equations can be recycled with the
\reqno{FOO}
command, as with
equation :
\rndeqno{FOO}
and
\rdeqno{FOO}
will produce strange results with
two (different) partial equation numbers if FOO
refers to a partially numbered equation.)
The next equation was written with $$ ... $$
and
a \deleqno
command at the end:
\reqno
above did not affect the equation number
counter. The following equation is also set within
$$ ... $$
, but it uses the command
\nydeleqno
to produce an equation number with a
new main number:
Now we will elaborate a little on \rndeqno{FOO}
and \rdeqno{FOO}
. Let us use
equation , and see what happens if we use the
\rndeqno{FOO}
command:
\rdeqno{Demo3}
at the end. This is great
fun, so why not one more:
There is still one equation to write. This time we
again use the deqarr environment:
This example also shows the use of the \where
command, which is a special case of the \rem
command.
Now, the interesting thing of referring to the recycled
equations is ahead. If one writes \ref{Demo4}
,
this is what LATEX will return: . That is
not too instructive, since the partial equation numbers
are quite common in this document. To make the complete
reference, use \ref{Demo3}\ref{Demo4}
. The
reference is much more
comprehensible, right? (If you get bad line-breaks at
such references, put them in an \mbox{...}
.)
Finally, the ! If you want your equations left-aligned, just specify the leqno option for the documentclass you are using. It should work! If you have any suggestions, corrections or contributions, please contact me. Enjoy LATEX!
mats d.